﻿using MultiAgentsServer.Scripts.Services.DataModels;
using OpenAI.ObjectModels.RequestModels;

namespace MultiAgentsServer.Scripts.Hubs;

#region SignalRHub -> ChatContextManager
public record RegisterCommand(string ConnectionId, string Username, string Password, string InvitationCode);
public record ChangePasswordCommand(string ConnectionId, string SessionId, int UserId, string PreviousPassword, string NewPassword);
public record LoginCommand(string ConnectionId, string SessionId, string DeviceSerialNumber, string Username, string Password, bool IsRemeberMe); 
public record SaveSessionIdCommand(string ConnectionId, string SessionId, int UserId, UserCookieDataModel.HubConnectionClassEnum ConnectionClass); 
public record AutoLoginCommand(string ConnectionId, string SessionId, string Username, string Password);
public record LogoutCommand(string ConnectionId, string SessionId, int UserId);
public record FetchUserdataCommand(string ConnectionId, string SessionId, int UserId);
public record FetchProjectSettingsCommnad(string ConnectionId, string SessionId, int UserId, int PrjId);
public record SaveProjectSettingsCommnad(string ConnectionId, string SessionId, int UserId, int PrjId, string PrjSettings);
public record AllowToolCallChangedCommnad(string ConnectionId, string SessionId, int UserId, bool IsAllow);
public record SendUserMsgCommand(string ConnectionId, string SessionId, int UserId, string UserName, int RoomId, string OsSystemMsg, string UserMessage, Dictionary<string, string> Images, Dictionary<string, string> TextFiles, string Model, List<ToolDefinition>? ToolSet);
public record ResendMessageCommand(string ConnectionId, string SessionId, int UserId, int MessageId, string Content, string Model, string OsSystemMsg, List<ToolDefinition>? ToolSetJson);
public record OverrideMessageCommand(string ConnectionId, string SessionId, int UserId, int MessageId, string Content);
public record SendUserMessageWithoutLLMResponseCommand(string ConnectionId, string SessionId, int UserId, string UserName, int RoomId, string UserMessage);
public record SendNodeMessageCommand(string ConnectionId, string SessionId, int UserId, string UserName, int RoomId, string Message, string WorkflowName);
public record StopUserMsgCommnad(string ConnectionId, string SessionId, int UserId);
public record SendToolResultCommand(string ConnectionId, string SessionId, int UserId, string UserName, int ToolCallMessageId, string Model, string OsSystemMsg, Dictionary<string, string> ToolCallResults);
public record CreateProjectCommand(string ConnectionId, string SessionId, int UserId, string ProjectName, string ProjectSettings);
public record DeleteProjectCommand(string ConnectionId, string SessionId, int UserId, int ProjectId);
public record CreateChatRoomCommand(string ConnectionId, string SessionId, int UserId, int ProjectId, string ChatRoomName);
public record SwitchChatRoomCommand(string ConnectionId, string SessionId, int UserId, int ChatRoomId);
public record GetFileContentCommand(string ConnectionId, string SessionId, int UserId, int ImageId);
public record SwitchChatRoomBranchCommand(string ConnectionId, string SessionId, int UserId, int ChatRoomId, int MessageId);
public record SubscriptonGitlabPullRequestCommand(string ConnectionId, string SessionId, int UserId, int WorkflowId, string RepositoryURL, bool ShouldAskMe);

public record RemoveConnectionCommand(string ConnectionId);
public record ServerNodeLLMSwitchRequestCommand(string ConnectionId, string SessionId, int UserId, string NodeId, string Message, List<string> Categories);
public record ServerNodeParameterExtractionRequestCommand(string ConnectionId, string SessionId, int UserId, string NodeId, string Context, List<string> Descriptions);
public record ArchiveChatRoomCommand(string ConnectionId, string SessionId, int UserId, int ChatRoomId);
public record DeleteChatRoomCommand(string ConnectionId, string SessionId, int UserId, int ChatRoomId);
public record RenameChatRoomCommand(string ConnectionId, string SessionId, int UserId, int ChatRoomId, string ChatRoomName);
#endregion

public record RecievePullRequestCommand(Dictionary<string, string> MergeRequestInfo); // Webhook -> ChatContextManager
